<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/27 0027
 * Time: 16:41
 */

namespace app\api\model;


class Product extends BaseModel
{
    public static function getMostRecent($count)
    {
        $products = self::limit($count)
            ->order('id desc')
            ->select();
        return $products;

    }

    public static function getProductByCategoryID($categoryID)
    {
        $products = self::where('category_id', '=', $categoryID)
            ->select();
        return $products;
    }
}